#include <stdio.h>
#include "string.h"
#include "stdlib.h"
int main() {
    char * pName = "Smith,James";
    int dotIndex = -1;
    for (int i = 0; i < strlen(pName); ++i) {
        if (pName[i] == ',') {
            dotIndex = i;
            break;
        }
    }
    char * newName = (char *)malloc(sizeof (char ) * strlen(pName));
    newName[dotIndex] = ' ';
    for (int i = dotIndex + 1; i < strlen(pName); ++i) {
        newName[i - dotIndex - 1] = pName[i];
    }
    for (int i = 0; i < dotIndex; ++i) {
        newName[i + dotIndex + 1] = pName[i];
    }
    printf("%s\n", newName);
    return 0;
}
